package ro.gillardon.persistence.document.model;

/**
 * Contains methods and details specific to a user (name, department, username).
 *
 * @author haiurar
 */
public class User extends ODocumentClass {

  private static final String USERNAME = "username";
  private static final String DEPARTMENT = "department";
  private static final String NAME = "name";

  /**
   * Instantiates a new user.
   *
   * @param name the users's name
   * @param department the user's department
   * @param username the user's username
   */
  public User(final String name, final String department, final String username) {
    super();
    this.doc.field(NAME, name);
    this.doc.field(DEPARTMENT, department);
    this.doc.field(USERNAME, username);
  }

  /**
   * Gets the user's name.
   *
   * @return the user's name
   */
  public String getName() {
    return this.doc.field(NAME);
  }

  /**
   * Gets the user's department.
   *
   * @return the user's department
   */
  public String getDepartment() {
    return this.doc.field(DEPARTMENT);
  }

  /**
   * Gets the user's username.
   *
   * @return the username
   */
  public String getUsername() {
    return this.doc.field(USERNAME);
  }
}
